package utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import android.location.Location;

public class Tools {
	
	public static String convertDateToString(Date date){
		SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss", Locale.CANADA);
		return df.format(date);
	}
	
	public static int compareDate(Date date1, Date date2){
		if(date1.after(date2)){
			return 1;
		}
		else if(date1.before(date2)){
			return -1;
		}	
		else{
			return 0;
		}
	}
	
	public static float getDistance(Location loc1, Location loc2){
		return loc1.distanceTo(loc2);
	}
	
	public static Location getCurrentPosition(){
		//TODO
		Location l = new Location("");
		l.setLatitude(20);
		l.setLongitude(30);
		return l;
	}
	
}
